//
//  EnumTest.m
//  xsd2cocoa
//
//  Created by Uwe Pachler on 03.01.14.
//
//

#import <SenTestingKit/SenTestingKit.h>

#import "TLGlobalElement.h"

@interface ListTest : SenTestCase {
	NSBundle* bundle;
}

@end


@implementation ListTest

- (void)testExample
{
    NSURL *xml1URL = [bundle URLForResource:@"testList" withExtension:@"xml"];
    
    NSData* fileData = [NSData dataWithContentsOfURL: xml1URL];
    
    TLGlobalElement* ge = [TLGlobalElement fromGlobalElement: fileData];
    
    STAssertTrue(ge != nil, @"reader must be loaded");
	STAssertEquals((NSUInteger)5, [ge.multiString count], @"multiString should contain 5 elements");
    STAssertEqualObjects([NSNull null], [ge.multiString objectAtIndex:0], @"attribute");
    STAssertEqualObjects([NSNull null], [ge.multiString objectAtIndex:1], @"attribute");
    STAssertEqualObjects(@"A", [ge.multiString objectAtIndex:2], @"attribute");
    STAssertEqualObjects(@"BB", [ge.multiString objectAtIndex:3], @"attribute");
    STAssertEqualObjects(@"C und D", [ge.multiString objectAtIndex:4], @"attribute");

}

-(void)setUp {
    bundle = [[NSBundle bundleForClass:[ListTest class]] retain];
}

@end
